home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / sharew / packer / zlib / zlib.3x < prev    next >
Encoding:
Text File  |  1990-11-17  |  2.5 KB  |  78 lines

  1. NAME  
  2.     zlib - stream interface    to compress, read only 
  3.  
  4. SYNOPSIS  
  5.     #include <zlib.h> 
  6.  
  7.     ZFILE *zfopen (fileptr,    how) 
  8.     char *fileptr; 
  9.     char *how; 
  10.  
  11.     ZFILE *zfilter (f) 
  12.     FILE *f; 
  13.  
  14.     int zfgetc (z) 
  15.     ZFILE *z; 
  16.  
  17.     int zfeof (z) 
  18.     ZFILE *z; 
  19.  
  20.     void zfclose (z) 
  21.     ZFILE *z; 
  22.  
  23.     char *zfgets (line, len, zfp) 
  24.     char *line; 
  25.     int len; 
  26.     ZFILE *zfp; 
  27.  
  28. DESCRIPTION  
  29.     This  implementation supplies 'z' versions of fopen, fputc, feof
  30.     and fclose to be used as direct    substitutes for     the  originals;
  31.     it  would  be  cleaner    and  more  transparent if the decompress
  32.     filter were hidden under the real stdio    procedures.    An  extra
  33.     call  zfilter()     is supplied to    convert    an already-opened stream
  34.     into a z-stream: see the example at the    end of this file.   Note
  35.     that  on  the Atari, depending on the shell, stdin may have been
  36.     opened as an ASCII stream and hence these routines are    useless.
  37.     A pre-existion stream MUST have    been opened as a binary    file.  
  38.  
  39.     If  a  file  opened  by     zfopen()  was not compressed, the files
  40.     contents are still recovered correctly at the low expense of  an
  41.     extra procedure     call  per  byte.   This makes the routines more
  42.     generally usable - they    can be left in production programs which 
  43.     can be speeded up in the field    by  compressing     selected  input
  44.     files  (see  NOTES);  also,  files  can     be  compressed     or  not
  45.     selectively depending on  whether  the    compression  makes  them
  46.     smaller     or  not  -  code  accessing  the files    does not need to
  47.     know.  
  48.  
  49. NOTES  
  50.     Reading    from a compressed file off floppy disk    is  faster  than
  51.     reading    from  an uncompressed file.  This probably isn't true of
  52.     hard disks though.  
  53.  
  54.     The original decompress    has been restructured so that  data  can
  55.     be fetched  on demand a    byte at    a time.     This lets it be used as
  56.     a filter for programs which read large data files - you     do  not
  57.     need the disk space to decompress the input files first.  
  58.  
  59.     Incidentally, programs reading data off    floppies will be speeded 
  60.     up  because  decompression  is always faster than the equivalent
  61.     amount of disk I/O.  
  62.  
  63. BUGS  
  64.     Opening    a file "r" will    not do    CR/LF  processing  on  computers
  65.     with this  file     structure.  Actually, I force all fopens in the
  66.     code to    ba fopenb (Alcyon  flavor)  so    this  is  not  really  a
  67.     problem.  
  68.  
  69. SEE ALSO  
  70.     intro(3S), fopen(3S)
  71.  
  72. AUTHOR    
  73.     Graham Toal, 3rd September 1988.  
  74.     My changes released to public domain.  
  75.     Updated    Nov 90.     
  76.  
  77.     Modified for Atari ST (Alcyon) by Bill Rosenkranz 
  78.